﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Master/HomeSubMaster.master"
    CodeBehind="RatingService.aspx.cs" Inherits="CSP.Web.MyHome.Credit.RatingService" %>

<asp:Content ID="CSPHead" runat="server" ContentPlaceHolderID="CSPHead">
    <meta charset="utf-8">
    <title>评价</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
</asp:Content>
<asp:Content ID="CSPStyleAndScript" runat="server" ContentPlaceHolderID="CSPStyleAndScript">
    <script src="/Scripts/UI/Expand/dialog.js" type="text/javascript"></script>
    <script>

        var CreditGrade = function () {
            //            user_rate: "#user_rate1",
            this.user_rate;
            this.textId;
            this.Get_Rate = function (rate) {
                var that = this;
                rate = rate.toString();
                var s;
                var g;
                $(this.user_rate).find(".g").show();
                if (rate.length >= 3) {
                    s = 5;
                    g = 0;
                    $(this.user_rate).find(".g").hide();
                } else if (rate == "0") {
                    s = 0;
                    g = 0;
                } else {
                    s = rate.substr(0, 1);
                    g = rate.substr(1, 1);
                }
                $(this.user_rate).find(".s").text(s);
                $(this.user_rate).find(".g").text("." + g);
                $(this.user_rate).find(".big_rate_up").animate({ width: (parseInt(s) + parseInt(g) / 100) * 28, height: 28 }, 1000);
                $(this.user_rate).find(".big_rate_bak b").each(function () {
                    $(this).mouseover(function () {
                        $(that.user_rate).find(".big_rate_up").width($(this).attr("rate") * 28);
                        $(that.user_rate).find(".s").text($(this).attr("rate"));
                        $(that.user_rate).find(".g").text("");
                    }).click(function () {
                        $(that.user_rate).find(".f").text($(this).attr("rate"));
                        $(that.user_rate).find(".my_rate").show();
                        $(that.textId).val($(this).attr("rate"));
                    })
                })
                $(this.user_rate).find(".big_rate_bak").mouseout(function () {
                    $(that.user_rate).find(".s").text(s);
                    $(that.user_rate).find(".g").text("." + g);
                    $(that.user_rate).find(".big_rate_up").width((parseInt(s) + parseInt(g) / 100) * 28);
                })
            };
            this.Up_Rate = function (rate) {
                $(this.user_rate).find(".big_rate_up").width("0");
                this.Get_Rate(rate);
            }
        };
        var ServiceAbility;
        var ServiceAttitude;
        $(function () {
            //服务能力
            ServiceAbility = new CreditGrade();
            ServiceAbility.user_rate = "#ServiceAbility"
            ServiceAbility.textId = "#<%=Txt_ServiceAbility.ClientID %>";
            ServiceAbility.Get_Rate(00);

            //服务态度
            ServiceAttitude = new CreditGrade();
            ServiceAttitude.user_rate = "#ServiceAttitude"
            ServiceAttitude.textId = "#<%=Txt_ServiceAttitude.ClientID %>";
            ServiceAttitude.Get_Rate(00);
        });

        function Btn_Submit_Click() {
            if ($("#<%=Txt_ServiceAttitude.ClientID %>").val() == "") {
                DialogMessage.Show(2, "必须为服务态度打分");
                return false;
            }

            if ($("#<%=Txt_ServiceAbility.ClientID %>").val() == "") {
                DialogMessage.Show(2, "必须为服务能力打分");
                return false;
            }
        }

    </script>
</asp:Content>
<asp:Content ID="CSPCrumbs" runat="server" ContentPlaceHolderID="CSPCrumbs">
    <!--面包屑Crumbs-->
    <div class="crumbs">
        <span>您当前所在的位置：</span> <a href="/">首页</a> &gt; <a href="/MyHome/Account/Management.aspx">我的家园</a> &gt; <a href="#">
            我的合作订单</a> &gt; <span>评价</span>
    </div>
</asp:Content>
<asp:Content ID="CSPMain" runat="server" ContentPlaceHolderID="CSPMain">
    <div class="box-bd grid-m0">
        <div class="tabs tabs-home mt10">
            <div class="tabs-nd">
                <ul class="tabs-hd">
                    <li class="trigger current">评价</li>
                </ul>
            </div>
            <div class="tabs-bd">
                <div class="tabs-panel evaluate">
                    <div class="partner-info">
                        <div class="info-base">
                            <span class="fl course-img">
                                <img src="/images/course-pic.png" alt="">
                            </span>
                            <div class="info-text">
                                <h3>
                                    <a href="#">
                                        <asp:Label ID="LB_ServiceTitle" runat="server">
                                        
                                        </asp:Label></a>
                                </h3>
                                <p>
                                    服务者：<a class="fc-blue" href="#"><asp:Label ID="LB_ServiceUser" runat="server">
                                        
                                    </asp:Label></a></p>
                            </div>
                        </div>
                        <CSP_U:SynthesizeUserCredit ID="U_UserCredit" IsShowConsumeCredit="false" runat="server" />
                    </div>
                    <!--partner-info-->
                    <div class="starrating f14">
                        <div class="rating-act clearfix mt10">
                            <div class="rate-control">
                                <span class="fl">信誉评价：</span>
                                <ul>
                                    <li class="good">
                                        <label for="rate-good-164650474659209">
                                            <input type="radio" class="good-rate" runat="server" id="R_Good" value="0" name="rates164650474659209">
                                            <i class="icon icon-rank icon-good"></i><span class="label-hidden">好评</span>
                                        </label>
                                    </li>
                                    <li class="normal">
                                        <label for="rate-normal-164650474659209">
                                            <input type="radio" class="noraml-rate" runat="server" id="R_General" value="1" name="rates164650474659209">
                                            <i class="icon icon-rank icon-normal"></i><span class="label-hidden">中评</span>
                                        </label>
                                    </li>
                                    <li class="bad">
                                        <label for="rate-bad-164650474659209">
                                            <input type="radio" class="bad-rate" runat="server" id="R_Bad" value="2" name="rates164650474659209">
                                            <i class="icon icon-rank icon-bad"></i><span class="label-hidden">差评</span>
                                        </label>
                                    </li>
                                </ul>
                            </div>
                            <div class="rate-msg-handle">
                                <a class="show-msg-box" href="#" style="display: none;"><i class="icon icon-addcomment">
                                </i><span>添加评论</span></a>
                            </div>
                        </div>
                        <!--rating-act-->
                        <div class="clearfix mt30">
                            <div class="fl">
                                服务态度：</div>
                            <div id="ServiceAttitude" class="user_rate">
                                <div class="big_rate_bak">
                                    <b rate="1" onclick="javascript:ServiceAttitude.Up_Rate(10);"></b><b rate="2" onclick="javascript:ServiceAttitude.Up_Rate(20);">
                                    </b><b rate="3" onclick="javascript:ServiceAttitude.Up_Rate(30);"></b><b rate="4"
                                        onclick="javascript:ServiceAttitude.Up_Rate(40);"></b><b rate="5" onclick="javascript:ServiceAttitude.Up_Rate(50);">
                                        </b>
                                    <div style="width: 45px; height: 15px;" class="big_rate_up">
                                    </div>
                                </div>
                                <p>
                                    <span class="s"></span><span class="g"></span>
                                </p>
                            </div>
                        </div>
                        <div id="ServiceAbility" class="clearfix mt30">
                            <div class="fl">
                                执教能力：</div>
                            <div class="user_rate">
                                <div class="big_rate_bak">
                                    <b rate="1" onclick="javascript:ServiceAbility.Up_Rate(10);"></b><b rate="2" onclick="javascript:ServiceAbility.Up_Rate(20);">
                                    </b><b rate="3" onclick="javascript:ServiceAbility.Up_Rate(30);"></b><b rate="4"
                                        onclick="javascript:ServiceAbility.Up_Rate(40);"></b><b rate="5" onclick="javascript:ServiceAbility.Up_Rate(50);">
                                        </b>
                                    <div style="width: 45px; height: 15px;" class="big_rate_up">
                                    </div>
                                </div>
                                <p>
                                    <span class="s"></span><span class="g"></span>
                                </p>
                            </div>
                        </div>
                        <div class="comment-textarea">
                            <textarea runat="server" id="Txt_RatingContent" placeholder="学习中或者授课中有什么感想，说两句吧......"></textarea>
                            <p>
                                <div style="display: none">
                                    <input type="text" id="Txt_ServiceAttitude" runat="server" />
                                    <input type="text" id="Txt_ServiceAbility" runat="server" />
                                </div>
                                <input type="submit" id="Btn_Submit" runat="server" onclick="return Btn_Submit_Click()"
                                    class="com-submit" onserverclick="Btn_Submit_ServerClick" value="提交"></p>
                        </div>
                    </div>
                </div>
                <!--tabs-panel-->
            </div>
            <!--tabs-bd-->
        </div>
        <!--tabs-->
    </div>
    <!--grid-m0-->
</asp:Content>
